<?php echo $this->Html->css(array(HOST.'/news.web.waldi'),null,array('inline'=>false));?>
<body>
<?php echo $this->Section->main(); ?>
<div class="container_4">	

	<div class="grid_1">
		<div class="logo"><?php echo $this->Html->link($this->Html->image(HOST.'/logo.png'),'/',array('escape'=>false));?></a></div>
	</div>
	
	<?php echo $this->element('aktualnosci-promocje')?>
	
	<div class="grid_3">
		<?php echo $this->element('menu-top')?>
	</div>
	
	<div class="clear"> </div>
	
	<div class="grid_4 header-small">

	</div>
	
	<div class="clear"> </div>
	
	<div class="grid_4 white padding_top_bottom">
		<div class="content">

		
		
		
		
				<div id="news-index-header">
				    
					<?php echo $this->Section->generate(1);?>
				
				    <div id="categories">
				        <ul>
				            <?php foreach ($newsGroups as $id => $name) {?>
				            	<li>
				            		<h3>
				            			<?php echo $html->link($name,array('plugin'=>'calendar','controller'=>'news','action'=>'display',$id),array('class'=>(($id == $selectedNewsGroups) ? 'sectionFilter active' : 'sectionFilter')))?>
					           		</h3>
				            	</li>
				            <?php }?>
				        </ul>
				        <div class="clear">
				        </div>
				    </div>
				    
				    
				</div>
				<div id="contentArea" style="width: 100%;">
					
					<?php foreach ($news as $year => $events) {?>
					<div class="one-third-col news-index-cat">
						<h3><?php echo $year?></h3>
							<?php foreach ($events as $key => $event) {?>
							<div class="news-index-item">
								<div class="title"><?php echo $this->Time->format('F j',$event['News']['on_date'])?></div>
								<div>
									<?php echo $html->link($event['News']['name'],array('plugin'=>'calendar','controller'=>'news','action'=>'view',$event['News']['id'],Inflector::slug($event['News']['name'],'-')),array('escape'=>false,'class'=>'fadeLink'))?>
								</div>
								<div class="content-small"><em><?php echo $event['News']['small_content']?></em></div>
							</div>
							<?php }?>
					</div>
					<?php }?>
				
				</div>

				<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>
				<?php $this->Footpanel->install();?>
				<div id="footpanel">
					<ul>
						<li><?php echo $this->Html->link(__('Home', true).'<small>'.__('Home', true).'</small>', array('plugin'=>'calendar','controller'=>'news','action'=>'display'),array('escape'=>false,'class'=>'home')); ?></li>
						<li><?php echo $this->Html->link(__('Add News', true).'<small>'.__('Add News', true).'</small>', 
							array('plugin'=>'calendar','controller'=>'news','action'=>'add'),
							array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_add.png)','onclick'=>"return hs.htmlExpand(this, { objectType: 'iframe', width:860, height:700,title:'Dodaj' } )")); ?></li>					
					</ul>
				</div>
				<?php }?>		
		
		
		
		
		
		</div>
	</div>
	
	<div class="clear"> </div>

	<?php echo $this->element('footer');?>
	
</div>
</body>
